require('./Tabselect.styl');
import { Tab } from 'saltui';
class Tabselect extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            active: '',
        };
        this.handleExchange = this.handleExchange.bind(this);
    }
    handleExchange(obj) {
        this.setState({ active: obj.active });
    }
    render() {
        let t = this;
        return (
            <div className="tabselect">
                <Tab activeKey={t.state.active} onChange={this.handleExchange} className="tabselect-tabbar">
                    {this.props.content && this.props.content instanceof Array && this.props.content.map((item, index) => {
                        return (
                            <Tab.Item title={item} key={`${index}`} />
                        )
                    })}
                </Tab>
            </div>
        );
    }

    componentWillMount() {
    }

    componentDidMount() {
    }

    componentWillReceiveProps(nextProps) {
    }

    shouldComponentUpdate(nextProps, nextState) {
        return true;
    }

    componentWillUpdate(nextProps, nextState) {
    }

    componentDidUpdate(prevProps, prevState) {
    }

    componentWillUnmount() {
    }
}

module.exports = Tabselect;
